<template>
	
	<view v-for="(item) in dataObj">
		<view v-if="item.mode==1">
			<CardViewText :title=item.title :isTop="item.isTop" :author="item.author" :evaluation="item.evaluation" >
				<template #tips v-if="item.showSearch">
					<view class="search">
						<text>搜索：</text>
						<view>
							<text>今日金价</text>
						</view>
						<view>
							<text>精选好物</text>
						</view>
					</view>
				</template>
			</CardViewText>
		</view>
		<view v-else-if="item.mode==2">
			<newsView :title=item.title :isTop="item.isTop" :author="item.author" :evaluation="item.evaluation" :imgUrl="item.imgUrl"></newsView>
		</view>
		<view v-else-if="item.mode==3">
			<Advertisement :title=item.title :isTop="item.isTop" :author="item.author" :imgUrl="item.imgUrl"></Advertisement>
		</view>

	</view>
</template>

<script>
	import CardViewText from "../../../../components/CardViewText.vue"
	import newsView from "../../../../components/NewsCardView.vue";
	import Advertisement from "../../../../components/Adment.vue";
	export default {
		components: {
			CardViewText,
			newsView,
			Advertisement
		},
		data() {
			return {
				dataObj: [
				  {
				    title: "全国教育大会部署：加快建设教育强国，办好人民满意的教育",
				    isTop: true,
				    author: "央视新闻",
				    evaluation: 1253,
				    showSearch: false,
					mode:1
				  },
				  {
				    title: "我国首个商业航天发射场正式启用，年内将执行5次发射任务",
				    isTop: true,
				    author: "中国航天报",
				    evaluation: 892,
				    showSearch: false,
					mode:1
				  },
				  {
				    title: "工信部：2025年我国新能源汽车渗透率将超45%，充电网络覆盖所有县城",
				    isTop: true,
				    author: "经济日报",
				    evaluation: 765,
				    showSearch: true,
					mode:1
				  },
				  {
				    title: "14个月从100家开到1000家门店，蜜雪冰城为何买下这家精酿啤酒商",
				    isTop: false,
				    author: "界面新闻",
				    evaluation: 632,
				    showSearch: false,
					imgUrl:["/static/newsimage/news1.png"],
					mode:2
				  },
				  {
				    title: "把握历史大势 共创美好未来（观沧海）",
				    isTop: false,
				    author: "人民日报",
				    evaluation: 589,
				    showSearch: false,
					imgUrl:["/static/newsimage/news2.png"],
					mode:2
				  },
				  {
				    title: "黄金还能走多远？卖方高呼“第三浪启动”，230多份研报看多",
				    isTop: false,
				    author: "财联社",
				    evaluation: 421,
				    showSearch: false,
					imgUrl:["/static/newsimage/news3.png"],
					mode:2
				  },
				  {
				    title: "加微信交友群，喜欢就聊，找喜欢的人",
				    isTop: false,
				    author: "我主良缘文化",
				    showSearch: false,
				  					imgUrl:["/static/ad/a1.png",
				  					"/static/ad/a2.png",
				  					"/static/ad/a3.png"],
				  					mode:3
				  },
				  {
				    title: "没有短板”的完美战鹰！歼-16机库独家探访",
				    isTop: false,
				    author: "红星新闻",
				    evaluation: 937,
				    showSearch: true,
					imgUrl:["/static/newsimage/news5.png"],
					mode:2
				  },
				  {
				    title: "多国学者共探巴克特里亚考古 携手推进丝绸之路文明研究新进程",
				    isTop: false,
				    author: "中国日报网",
				    evaluation: 386,
				    showSearch: false,
					imgUrl:["/static/newsimage/news4.png"],
					mode:2
				  }
				  
				 
				]
			}
		},
		methods: {

		}
	}
</script>

<style>
	.search{
		display: flex;
		font-size: 24rpx;
		color: blue;
	}
	.search>view:not(:last-child) {
		/* 固定间隔值 */
		margin-right: 10px;
	}
</style>